<?php

namespace app\common\model\link;

use app\common\model\BaseModel;

/**
 * 友情链接模型
 */
class Link extends BaseModel
{
    protected $name = 'link';
    protected $pk = 'link_id';

    /**
     * 获取列表
     */
    public function getList($limit = 20)
    {
        $where = [];
        return $this->where($where)->order(['sort' => 'asc'])->paginate($limit);
    }

    /**
     * 广告详情
     */
    public static function detail($link_id)
    {
        return (new static())->find($link_id);
    }

}